from PySide6.QtWidgets import QLabel
from widgets.Input import Input
from widgets.scriptWidgets.ScriptWidget import ScriptWidget


class ScriptTimeInput(Input):
    def __init__(self, parent: ScriptWidget, title, maxLength=6, inputType='number'):
        super(ScriptTimeInput, self).__init__(parent, title)
        self.setMaxLength(maxLength)
        self.setInputType(inputType)
        self.setFixedHeight(parent.lineHeight)
        self.text = 1000

        self.tail = QLabel('ms')
        self.tail.setFixedSize(20, Input.DEFAULT_HEIGHT)
        self.addTail(self.tail)
